package com.hxzy.module.store.api.store;

import com.github.pagehelper.PageInfo;
import com.hxzy.framework.common.resp.R;
import com.hxzy.module.store.api.enums.ApiConstants;
import com.hxzy.module.store.api.fallback.StoreFeignApiFallbackFactory;
import com.hxzy.module.store.api.store.req.StoreReq;
import com.hxzy.module.store.api.store.resp.StoreAccountResp;
import com.hxzy.module.store.api.store.resp.StoreResp;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.cloud.openfeign.SpringQueryMap;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;

/**
 * @Author wy
 * @Description store远程服务
 * @Date 2024/1/25 14:10
 * @Version 1.0
 */
@FeignClient(name = ApiConstants.SERVER_NAME,fallbackFactory = StoreFeignApiFallbackFactory.class)
public interface StoreFeignApi {

    /**
     * 远程访问门店列表信息
     * @param req
     * @return
     */
    @GetMapping(value = "/storeManage/storeList")
    R<PageInfo<StoreResp>> storeList(@SpringQueryMap StoreReq req);

    /**
     * 根据id查询门店信息
     * @param storeId
     * @return
     */
    @GetMapping(value = "/storeManage/{storeId}")
    R<StoreResp> findByStoreId( @PathVariable(value = "storeId") Long storeId);

    /**
     * 远程访问账门账户信息
     * @param account
     * @return
     */
    @GetMapping(value = "/storeAccount/find/{account}")
    R<StoreAccountResp> storeAccountFindByAccount(@PathVariable(value = "account") String account);
}
